package user

import (
	"log"

	"gin.andbridge/core/model"
	"gorm.io/gorm"
)

type User struct {
	db    *gorm.DB
	model *model.User
}

func (user *User) FindUserNameById(id int) *User {
	err := user.db.Model(user.model).Find(user.model).Error
	if err != nil {
		log.Panicf("GetUserNameById查询错误:%v", err)
	}
	return user
}
